var http = require('http');
var server = http.createServer();
server.on('request', function(req, res) {
	console.log('--request--');
	res.writeHead(200, {
		'Content-type': 'text/plain'
	});
	// res.end('Hello, world\n');
});
server.listen(8080, '127.0.0.1');
console.log('server start...');

// test the app
// node chp1-1.js
// in new cmd, type : curl -i 127.0.0.1:8080